<template>
    <view>
        <button type="primary" class="login-btn" open-type="getPhoneNumber"
                @getphonenumber="decryptPhoneNumber">本机号码一键登录
        </button>
    </view>
</template>
<script setup>
const decryptPhoneNumber = async (e) => {
    uni.login({
        success: async (res) => {
            console.log('res', res)
            const data = {
                code: res.code,
                encryptedData: e.detail.encryptedData,
                iv: e.detail.iv,
                sessionKey: 'sessionKey'
            }
            const result = await qly.api.auth.mobileAuth(data)
            if (result.success) {
            
            }
        }
    })
    
}
const getUserInfo = async () => {
    console.log('qly.api.user', qly.api)
    const result = await qly.api.user.getUserInfo()
    if (result.success) {
    
    }
}
onMounted(() => {
    getUserInfo()
})
</script>
<style lang="scss" scoped>
.picker-view {
    width: 50%;
    height: 200rpx;
}
</style>
